Skip to content

Input behaviour (#66, Part 2) - #70

Merged
n4ff4h merged 11 commits into
devfrom
fix/66-part2-inputs
Nov 18, 2026
Merged

n4ff4h merged 11 commits into
devfrom
fix/66-part2-inputs

Conversation

@n4ff4h

@n4ff4h n4ff4h commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Fixes Part 2 of #66 (input behaviour, items 2.1–2.10). One commit per item, each with a test that failed first.

Item Change
2.1 NumberInput A stepper field can be cleared and retyped: an empty stepper keeps its value while typing and falls back to min only on blur. Arrow keys and the − / + buttons now share one stepping function (toFixed(10) against float drift), so 10.5 + ArrowUp is 11.5, not 12.
2.2 SlugInput Typing a space (or any other word break) in manual mode inserts the separator, for any separator. toSlug(…, { preserveTrailing }) now works for every separator, not only -.
2.3 TagsInput Enter never adds a disabled suggestion and the arrow keys skip disabled rows. useComboboxState gained an isDisabled(index) option; TagsInput passes it.
2.4 Autocomplete The filter query follows a controlled value set from outside, so resetting to "" shows the full list.
2.5 InlineEdit Save/cancel triggered by blur no longer moves focus back to the display button, and a failing validate (or async save error) on blur shows the error without pulling focus back. Enter / Escape / the buttons still return or keep focus as before.
2.6 ReportingPeriodPicker commit() clears the pending custom range, so an abandoned custom click no longer overwrites a monthly/quarterly/yearly pick on close.
2.7 DateCalendar In the months/years/decades grids, PageUp/PageDown and arrows past the edge respect canPrev/canNext. PeriodGrid gained canPrev/canNext props (default true); handleGridKey gained canPage. The day view already stopped at min/max (checked).
2.8 HijriDatePicker inMonth compares against the next month's midnight, so a value or today with a time on the last day of the month opens focused on that day, not the 1st.
2.9 Wizard The busy flag stays set until onComplete settles (plus a ref guard against same-tick re-entry), so Finish can't run onComplete twice.
2.10 SearchBox The ✕ button prevents mousedown focus change, so clicking it with unsubmitted text fires one search ("") instead of the blur search followed by "".

Skipped ([P] / device check)

  • 2.1, third bullet: \d only matches ASCII digits for a custom numberLocale.
  • 2.5, third bullet: Safari not focusing buttons on click (Cancel may save first).

Could not reproduce

  • None. All ten items reproduced with a failing test.

Behaviour/API changes worth noting

  • toSlug("trailing ", { preserveTrailing: true }) now returns "trailing-" (it was "trailing"); the old test assertion pinned the bug and was updated.
  • useComboboxState(count, { isDisabled }) (internal) and PeriodGrid canPrev/canNext (internal) are new options.
  • Wizard: the Finish button stays disabled with a spinner while onComplete runs.
  • InlineEdit: an async save that fails after a blur no longer refocuses the field (same rule as the validate case).

Verification

  • pnpm lint, pnpm format:check, pnpm typecheck: pass
  • pnpm --filter @javaabu/onu exec vitest run --maxWorkers=3: 197 files, 2872 passed, 1 skipped
  • node scripts/check-docs.mjs: Docs OK
  • pnpm build and pnpm --filter @javaabu/onu size: pass, no budgets changed

🤖 Generated with Claude Code

agent and others added 10 commits November 18, 2026 05:16
…uttons (#66, 2.1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#66, 2.4)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 2.5)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 2.6)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…66, 2.7)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, 2.8)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 2.9)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…2-inputs

# Conflicts:
#	packages/onu/src/components/date/hijri-date-picker.tsx
@n4ff4h
n4ff4h merged commit a1667e4 into dev Nov 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant